//
//  M1VipItem.m
//  NewMarryU
//
//  Created by apple on 2018/7/22.
//  Copyright © 2018年 Cedar. All rights reserved.
//

#import "M1VipItem.h"

@implementation M1VipItem
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _m1_bgView = [[UIImageView alloc]init];
        [self addSubview:_m1_bgView];
        [_m1_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.centerY.equalTo(self);
        }];
        
        _m1_defaultView = [UIButton buttonWithType:UIButtonTypeCustom];
        _m1_defaultView.backgroundColor = [UIColor m1_colorHex:0xFF4637];
        [_m1_defaultView setTitle:@"推荐" forState:0];
        [_m1_defaultView setTitleColor:[UIColor whiteColor] forState:0];
        _m1_defaultView.titleLabel.font = m1_font(12);
        _m1_defaultView.layer.cornerRadius = 12.5;
        _m1_defaultView.clipsToBounds = YES;
        [self addSubview:_m1_defaultView];
        [_m1_defaultView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_offset(CGSizeMake(50, 25));
            make.centerX.equalTo(self);
            make.top.offset(4);
        }];
        
        _m1_titleLB = [[UILabel alloc]init];
        _m1_titleLB.textColor = [UIColor m1_colorHex:0x333333];
        _m1_titleLB.font = m1_font(15);
        [self addSubview:_m1_titleLB];
        
        [_m1_titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self.mas_centerX).offset(-18);
        }];
        
        _m1_priceLB = [[UILabel alloc]init];
        _m1_priceLB.textColor = [UIColor m1_colorHex:0x333333];
        _m1_priceLB.font = m1_boldFont(20);
        [self addSubview:_m1_priceLB];
        
        [_m1_priceLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.mas_centerY).offset(3);
            make.left.equalTo(self.mas_centerX).offset(-5);
        }];
        
        _m1_dexLB = [[UILabel alloc]init];
        _m1_dexLB.textColor = [UIColor m1_colorHex:0x999999];
        _m1_dexLB.font = m1_font(12);
        [self addSubview:_m1_dexLB];
        
        [_m1_dexLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.mas_centerY).offset(7);
            make.centerX.equalTo(_m1_priceLB.mas_centerX);
        }];
        
    }
    return self;
}
@end
